<div class="accordion project-dash-header" id="accordian0">
  <h2>Welcome back, <%= current_user.name %> </h2>




  <%if @admin_latest != nil %>

<div class="accordion-group ">
  <div class="accordion-heading project-listing-header">
    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion0" href="#managedCollapse0">
      New Announcements!
    </a>
  </div>

  <div id="managedCollapse0" class="accordion-body collapse dash-bg" style="height: 0px; ">
    <div class="alert alert-block alert-error fade in">
      <a class="close" data-dismiss="alert" href="#">×</a>
      <h4 class="alert-heading">Topic: <%= @admin_latest.topic%></h4>
      <div class="alert alert-block fade in announcement_border">
        <p><%= @admin_latest.content %></p>
      </div>
      <h7>Created: <%= @admin_latest.created_at%></h7>
    </div>
  </div>

</div>

<%end%>




</div>



<div class="accordion project-dash-header" id="accordion1">
<h3> Managed Projects </h3>

<% if @managed_projects.empty? %>

	<div class="alert alert-block fade in">
            <h4 class="alert-heading">No Projects</h4>
            <p>You can crete your own project here.</p>
            <p>
              <%= link_to "Create One", new_project_path, :class => "btn btn-create" %>
            </p>
          </div>

<% else %>


<% @managed_projects.each do |mp| %>
<div class="accordion-group ">
              <div class="accordion-heading project-listing-header">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#managedCollapse<%= mp.id %>">
                 <%= mp.name %>
                </a>
              </div>
              <div id="managedCollapse<%= mp.id %>" class="accordion-body collapse dash-bg" style="height: 0px; ">
                <div class="accordion-inner">
                	<table>
                		<tr>
                			<th>Contributors:</th>
                          <%if mp.users.count == 0 %>
                           <td><span class="badge badge-warning"><%= mp.users.count %></span> &nbsp;&nbsp;<b>Invite some!</b></td>
                              <%else%>
                            <td><span class="badge badge-success"><%= mp.users.count %></span></td>
                              <%end%>

                		</tr>
                		<tr>
                			<th>Resources:</th>
                           <%if  mp.resources.count  == 0 %>
                           <td><span class="badge badge-warning"><%=  mp.resources.count  %></span>&nbsp;&nbsp;<b>Add some!</b></td>
                              <%else%>
                            <td><span class="badge badge-success"><%=  mp.resources.count  %></span></td>
                              <%end%>

                		</tr>
                	</table>

                	<%= mp.description %>
                    <p>
                    <%= link_to "View", project_path(mp), :class => "btn btn-primary" %>
                    </p>

                </div>
              </div>
            </div>
<% end %>

            <p></p>
            <p>
              <%= link_to "Create One", new_project_path, :class => "btn btn-create" %>
            </p>

<% end %>
</div>



<div class="accordion project-dash-header" id="accordion2">
<h3> Contributing Projects </h3>

<% if @contrib_projects.empty? %>

	<div class="alert alert-block fade in">
            
            <h4 class="alert-heading">No Contributions Found</h4>
            <p>Some helpful suggestion message</p>
            <p>
              <%= link_to "Find One", projects_path, :class => "btn btn-create" %>
            </p>
          </div>


<% else %>

<% @contrib_projects.each do |mp| %>
<div class="accordion-group">
              <div class="accordion-heading project-listing-header">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#managedCollapse<%= mp.id %>">
                 <%= mp.name %>
                </a>
              </div>
              <div id="managedCollapse<%= mp.id %>" class="accordion-body collapse dash-bg" style="height: 0px; ">
                <div class="accordion-inner">
                	<table>
                		<tr>
                			<th>Contributors:</th>
                          <%if mp.users.count  == 0 %>
                           <td><span class="badge badge-warning"><%= mp.users.count %></span> &nbsp;&nbsp;<b>Invite some!</b></td>
                              <%else%>
                            <td><span class="badge badge-success"><%= mp.users.count %></span></td>
                              <%end%>
                		</tr>
                		<tr>
                			<th>Resources:</th>
                           <%if  mp.resources.count  == 0 %>
                           <td><span class="badge badge-warning"><%=  mp.resources.count  %></span>&nbsp;&nbsp;<b>Add some!</b></td>
                              <%else%>
                            <td><span class="badge badge-success"><%=  mp.resources.count  %></span></td>
                              <%end%>
                		</tr>
                	</table>

                	<%= mp.description %>
                    <p>
                    <%= link_to "View", project_path(mp), :class => "btn btn-primary" %>
                    </p>
                </div>
              </div>
            </div>
<% end %>
 <p></p>
      <p>
              <%= link_to "Join One", projects_path, :class => "btn btn-create" %>
            </p>
<% end %>
</div>




